package com.atguigu.study.controller;

import com.atguigu.study.service.ChatAssistant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Marco
 * @Description
 * @date 2025/8/16 23:54
 * @email 3293336923@qq.com
 */
@Slf4j
@RestController
public class DeclarativeAiServiceController {

    @Autowired
    private ChatAssistant  chatAssistant;


    @GetMapping("/langchain4j/marco")
    public    String     prompt(@RequestParam(value = "keyword", defaultValue = "你是谁" ) String    question){

        String result = chatAssistant.chat(question);
        log.info("result:{}",result);

        return   result;
    }

}
